home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / windows / tpwin31.zip / PATCH.DOC < prev    next >
Text File  |  1992-04-06  |  2KB  |  41 lines

  1. PATCH.COM
  2.  
  3. Syntax: patch [-u] dif_file prog_file [out_file]
  4.  
  5. PATCH.COM reads the text from dif_file and applies the patch to prog_file.
  6.  
  7. When applying a patch, PATCH.COM makes a first pass to check that all bytes
  8. in the file which will be changed, currently match the old values which are
  9. defined in dif_file.  If they don't, an error message is printed and the
  10. patch is not applied.  If they do match, all the corresponding bytes are
  11. changed to their new values.  If any error occurs during this second step,
  12. it is most likely an out of disk space error.  During the update, a backup
  13. copy of your original file (.BAK) is kept.  This means you need twice as
  14. much disk space if your input and output files are on the same disk drive.
  15. In case of an error, the temporary file is usually deleted and the .BAK file
  16. is renamed back to the original name.  If something else goes wrong, like a
  17. power outage, you should still have your original file on the disk with a
  18. .BAK extension.
  19.  
  20. After the patch is completed:
  21.   If the output file is the same as the input file, the .BAK file is deleted.
  22.   If the output file is different than the input file, the .BAK file is
  23.   renamed back to its original name.
  24.  
  25. The -u option cause PATCH.COM to undo the patch defined in dif_file.  In this
  26. case, it checks that all the bytes to be modified match the new byte values
  27. on the first line of each pair.  It then changes the corresponding bytes to
  28. the old byte values defined on the second line of each pair.
  29.  
  30. The last parameter (out_file) is optional.  If defined, the patched version
  31. of the original file will be saved under the name specified by out_file, and
  32. the original file will be left intact.  If it is not specified, the patched
  33. version of the file will have the same name as the original version of the
  34. file, and the original version of the file will be lost.
  35.  
  36. Note:  Because PATCH.COM checks the old values of each byte to be patched,
  37. two or more patches which affect the same byte must be applied in order.
  38. Also, because of the fixed offsets defined in dif_file, the same dif_file will
  39. probably not be usable with multiple versions of the program file being
  40. patched.
  41.